package org.example.buysystem.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.buysystem.common.Result;
import org.example.buysystem.entity.User;
import org.example.buysystem.utils.TokenUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value="角色",tags = {"角色管理"})
public class RoleController {

    @PostMapping("/role")
    @ApiOperation(value = "获取用户角色")
    public Result getUserRole(){
        User getcurrent = TokenUtils.getCurrentUser();
        return Result.success(getcurrent.getRole());
    }
}
